/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('fOrder', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field: 'id'
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'create_time'
    },
    shipmentNumber: {
      type: DataTypes.STRING(120),
      allowNull: true,
      field: 'shipment_number'
    },
    status: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'status'
    },
    userId: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      field: 'user_id'
    },
    shipmentId: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      field: 'shipment_id'
    },
    isMention: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      field: 'is_mention'
    },
    totalPrice: {
      type: DataTypes.DECIMAL,
      allowNull: true,
      field: 'total_price'
    },
    finished: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'finished'
    },
    payed: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'payed'
    },
    logisticsCompany: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'logistics_company'
    },
    recommenderId: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      field: 'recommender_id'
    }
  }, {
    tableName: 'f_order'
  });
};
